//"word": "上海长城饭店",
//"type": "hotel",
//"price": "实时计价",
//"star": "二星级",
//"zonename": "北外滩 ",
//"districtname": "上海",
//"url": "http://m.ctrip.com/webapp/hotel/hoteldetail/2304322.html?atime=20190624"
///搜索模型
class SearchModel {
  String keyword;
  final List<SearchItem> data;

  SearchModel({this.keyword, this.data});

  factory SearchModel.fromJson(Map<String, dynamic> json) {
    var dataJson = json['data'] as List;
    List<SearchItem> data =
        dataJson.map((i) => SearchItem.fromJson(i)).toList();
    return SearchModel(data: data);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['data'] = this.data;
    return data;
  }
}

class SearchItem {
  final String word;
  final String type;
  final String price;
  final String star;
  final String districtname;
  final String zonename;
  final String url;

  SearchItem(
      {this.word,
      this.type,
      this.price,
      this.star,
      this.districtname,
      this.zonename,
      this.url});

  factory SearchItem.fromJson(Map<String, dynamic> json) {
    return SearchItem(
        word: json['word'],
        type: json['type'],
        price: json['price'],
        star: json['star'],
        districtname: json['districtname'],
        zonename: json['zonename'],
        url: json['url']);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['word'] = this.word;
    data['type'] = this.type;
    data['price'] = this.price;
    data['star'] = this.star;
    data['districtname'] = this.districtname;
    data['zonename'] = this.zonename;
    data['url'] = this.url;
    return data;
  }
}
